package com.yc.controller;


import com.yc.entity.Cartoon;
import com.yc.entity.Categorysecord;
import com.yc.mapper.CategorysecordMapper;
import com.yc.service.ICategorysecordService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * InnoDB free: 4096 kB 前端控制器
 * </p>
 *
 * @author ly
 * @since 2022-05-25
 */
@Controller
@RequestMapping("//categorysecord")
public class CategorysecordController {
    @Resource
    private ICategorysecordService iCategorysecordService;

    @Resource
    private CategorysecordMapper categorysecordMapper;

    @RequestMapping("banner")
    @ResponseBody
    public String banner(Integer ctid){
        String csname=categorysecordMapper.banner(ctid);
        return csname;
    }

    @RequestMapping("queryEdition")
    @ResponseBody
    public String queryEdition(Integer ctid){
        return categorysecordMapper.queryEdition(ctid);
    }

    @RequestMapping("queryByCsname")
    @ResponseBody
    public List< Categorysecord > queryByCsname(@RequestBody List< Cartoon > list,String edition,String classname){
        return iCategorysecordService.queryByCsname(list,edition,classname);
    }

    @RequestMapping("queryByCid")
    @ResponseBody
    public List<Categorysecord> queryByCid(Integer cid){
        return iCategorysecordService.queryByCid(cid);
    }
}

